import React from 'react'
import { useRef, useEffect } from 'react'
class TsetC extends React.Component {
  getName = () => {
    console.log("11111")
  }
  render() {
    return <div>我是类组件</div>
  }
}
function App() {
  const testRef = useRef(null)
  const h1Ref = useRef(null)
  useEffect(() => {
    console.log(testRef.current)
    testRef.current.getName()
    console.log(h1Ref.current)
  }, [])
  return (
    <div>
      <TsetC ref={testRef}></TsetC>
      <h1 ref={h1Ref}>this is h1</h1>
    </div>
  )
}

export default App
